//
//  UIAlertController+Ext.m
//  BaseTdkc
//
//  Created by DavidHuang on 16/7/22.
//  Copyright © 2016年 黄栋炜. All rights reserved.
//

#import "UIAlertController+Ext.h"

@implementation UIAlertController (Ext)

- (void)varlidateUserPassword:(ValidateBlock) validateBlock {
   [self addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
        textField.placeholder = @"请输入账户密码";
   }];
    
    //输入密码
    UIAlertAction *action  = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        UITextField *textField = [self.textFields firstObject];
        validateBlock (textField.text);
    }];
    [self addAction:action];
    
}
- (void)inputBaseMapNameAndDownload:(ValidateBlock)validateBlock {
    [self addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
        textField.placeholder = @"请输入底图数据包名";
    }];
    
    //输入密码
    UIAlertAction *action  = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        UITextField *textField = [self.textFields firstObject];
        validateBlock (textField.text);
    }];
    [self addAction:action];
}

@end
